package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lucky on 2018/1/9.
 */
public class RuleSaveModel extends RuleModel {
    public RuleSaveModel() {
        this.parts = null;
        this.questionCategories = null;
    }

    /**
     * 策略模块列表
     */
    private List<RulePartSaveModel> parts;

    /**
     * 试题应用类别
     */
    private List<String> questionCategories;

    /**
     * Gets part list.
     *
     * @return the section list
     */
    public List<RulePartSaveModel> getParts() {
        if (parts == null) {
            parts = new ArrayList<>();
        }
        return parts;
    }

    /**
     * Gets question category.
     *
     * @return the question category
     */
    public List<String> getQuestionCategories() {
        if (questionCategories == null) {
            questionCategories = new ArrayList<>();
        }
        return questionCategories;
    }

    /**
     * Copy to input rule input model.
     *
     * @return the rule input model
     */
    public RuleInputModel copyToInput() {
        RuleInputModel model = new RuleInputModel();
        model.setRuleID(this.getRuleID());
        model.setItemBankID(this.getItemBankID());
        model.setRuleName(this.getRuleName());
        model.setTotalScore(this.getTotalScore());
        model.setTimeLimited(this.isTimeLimited());
        model.setCreatorId(this.getCreatorId());
        model.setCreateTime(this.getCreateTime());
        model.setModifierId(this.getModifierId());
        model.setModifyTime(this.getModifyTime());
        return model;
    }
}
